1. Field
This disclosure relates to nonce generation.
2. Related Art
A nonce is a unique identifier that can be used for various purposes. For example, a nonce can also be used for C or C++ header file include guards. A nonce can also be used by Uniform Resource Locator (URL) shortening services to shorten a URL into a shorter URL. Thereafter, the URL can be referred to using the shorter URL. A nonce can also be used by online retailers, electronic service providers, or others to uniquely identify transactions.
One nonce generation scheme in use today is a central entity that increments a counter. For example, an auto-increment counter can be used in a database system and incremented each time a nonce is requested. If the central entity is contended with numerous requests for nonces, the central entity becomes a bottleneck for requests.
Industry standards GUID (globally unique identifier), UUIDv1 (universally unique identifier version 1) and UUIDv4 (universally unique identifier version 4) are identifier standards for distributed nonce generation. The UUID is a randomly generated 128-bit value that is defined such that the chance of two computer systems generating a UUID with the same 128-bit value is small, but uniqueness is not guaranteed, and collision is hard to detect. Further, the length of an identifier used to reduce the probability of collision may be wasteful for some applications. For example, in a database table of key-value pairs keyed by UUID, the size of the value may be smaller than the size of the key.